package Java常用类的学习;

import java.util.HashMap;

public class AlphaDegree {
    public static void main(String[] args) {
        String s="afasdfassgdfgdfglsdlslgja";
        char [] num=s.toCharArray();
        int i=num.length-1;
        HashMap map=new HashMap();
        map.put(num[0],1);
//        System.out.println(map);
//        map.forEach((key,value)->System.out.print(key+"="+value+" "));

        for(int k=1;k<=i;k++){
            if(map.containsKey(num[k])){
                Integer j=(Integer)map.get(num[k]);
                map.put(num[k],++j);
            }
            else
                map.put(num[k],1);
        }
        map.forEach((key,value)->System.out.print(key+"="+value+" "));
    }
}
